package com.example.paint;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class MainActivity extends Activity {
	
	ImageButton datNew;
	ImageButton datSave;
	ImageButton datBrush;
	ImageButton datEraser;
	ImageButton datColors;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		
		datNew = (ImageButton)findViewById(R.id.DatNew);
		datSave = (ImageButton)findViewById(R.id.DatSave);
		datBrush = (ImageButton)findViewById(R.id.DatBrush);
		datEraser = (ImageButton)findViewById(R.id.DatEraser);
		datColors = (ImageButton)findViewById(R.id.DatColors);
		
		datNew.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				
				final AlertDialog.Builder datNewDialog = new AlertDialog.Builder(MainActivity.this);	
				datNewDialog.setMessage("This will delete any unsaved projects.");
				datNewDialog.setTitle("New Project?");
				
				datNewDialog.setPositiveButton("Yes", new DialogInterface.OnClickListener(){

					@Override
					public void onClick(DialogInterface arg0, int arg1) {
						// TODO Auto-generated method stub
						
					}
					
				});
				
				datNewDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener(){

					@Override
					public void onClick(DialogInterface dialog, int which) {
						// TODO Auto-generated method stub
						
					}});
				
				datNewDialog.show();
				
			}
			
		});
		
		datSave.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				
				Toast.makeText(getApplicationContext(), "Image Saved Successfully", Toast.LENGTH_SHORT).show();	
			}	
		});
		
		datBrush.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stubfinal AlertDialog.Builder datNewDialog = new AlertDialog.Builder(MainActivity.this);	
				
				final Dialog datBrushDialog = new Dialog(MainActivity.this);	
				datBrushDialog.setContentView(R.layout.brush_dialog_layout);
				datBrushDialog.setTitle("Brush Size");
				datBrushDialog.show();		
			}
			
		});
		
		datEraser.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				
				final Dialog datEraserDialog = new Dialog(MainActivity.this);	
				datEraserDialog.setContentView(R.layout.eraser_dialog_layout);
				datEraserDialog.setTitle("Eraser Size");
				datEraserDialog.show();
				
			}
			
		});
		
		datColors.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				
				final Dialog datColorsDialog = new Dialog(MainActivity.this);	
				datColorsDialog.setContentView(R.layout.colors_dialog_layout);
				datColorsDialog.setTitle("Color Palette");
				datColorsDialog.show();
				
			}
			
		});
	}
}
